package com.uinfor.controller;

import com.uinfor.entity.Payment;
import com.uinfor.entity.Result;
import com.uinfor.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @descripttion:
 * @Author: WZH
 * @Date :2021/1/22  10:33
 **/
@RestController
@Slf4j
public class FeignOrderController {
    @Resource
    private PaymentFeignService paymentFeignService;
    @GetMapping("/consumer/payment/{id}")
    public Result<Payment> getPaymentByID(@PathVariable("id")Long id){
        return paymentFeignService.getPaymentById(id);
    }
    @GetMapping("/consumer/feign/timeout")
    public String payMentFeignTimeOut(){
        return paymentFeignService.payMentFeignTimeOut();
    }

}
